// Fill out your copyright notice in the Description page of Project Settings.

#include "SocketMessge.h"
#include <sstream>

std::string stsocket::IntToString(int i) 
{
	std::stringstream ss;
	std::string str;
	ss << i;
	ss >> str;
	return str;
}

bool stsocket::SplitString(const std::string& data, std::string c, std::string* lstr, std::string* rstr,bool FromStart)
{
	std::string::size_type pos1 = FromStart ?data.find(c): data.rfind(c);
	if (std::string::npos != pos1) 
	{
		if (lstr)
		{
			*lstr = data.substr(0, pos1);
		}
		if (rstr)
		{
			*rstr = data.substr(pos1+c.size(), data.size());
		}
		return true;
	}

	return false;
}